package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.domain.db.Report;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ReportMapper extends BaseMapper<Report> {
    @Select("select user_id from tb_report where user_id  != #{userId} and  questionnaire_id= #{questionnaireId} and score BETWEEN #{score}-10 and #{score}+10 ORDER BY ABS(score-#{score})")
     List<Long> similarYou(@Param("score") Integer score, @Param(("userId")) Long userId, @Param("questionnaireId") String questionnaireId);
}
